package com.heatup.apt.common.dao.coach;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;

import com.baomidou.mybatisplus.mapper.AutoMapper;
import com.heatup.apt.model.coach.CoachInfo;
import com.heatup.apt.model.coach.CoachOngoingCourse;
import com.heatup.apt.model.coach.CoachStoreInfo;
import org.springframework.stereotype.Component;

/**
 *
 * CoachInfo 表数据库控制层接口
 *
 */
@Component
public interface CoachInfoMapper extends AutoMapper<CoachInfo> {

	/**
     * 根据课程ID查询主教练
     *
     * @param is_main
     * @param course_id
     * @return
     */
    CoachInfo selectCoachInfoByCourseId(@Param("isMain") int isMain, @Param("courseId") int courseId);



    /**
     * 查询某教练和门店信息
     *
     * @return
     */
  
    CoachStoreInfo selectStoreCoachInfo(@Param("coachId") int coachId);

    int selectCoachByConditionCount(@Param("nick_name") String nick_name,@Param("store_id") long store_id,@Param("level") long level, @Param("status") String status);

    List<CoachStoreInfo> selectCoachByCondition(@Param("nick_name") String nick_name,@Param("store_id") long store_id,@Param("level") long level, @Param("status") String status, @Param("offset") int offset, @Param("limit") int limit);


    /**
     * 查询教练总数
     * @param paramsMap
     * @return
     */
    int queryCoachCount(Map<String, Object> paramsMap);

    /**
     * 分页查询教练
     * @param paramsMap
     * @return
     */
    List<CoachInfo> queryCoachList(Map<String, Object> paramsMap);

    /**
     * 根据教练ID查询教练
     * @param id
     * @return
     */
    CoachInfo queryCoachByID(Integer id);

    /**
     * 根据教练id查询 该教练是否有正在上的私教课
     * @param
     * @return
     */
    int querySecretCourseCountByCoachId(@Param("coach_id") Long coach_id);

    /**
     * 根据店面查询私教教练
     * @param storeId
     * @return
     */
    @ResultMap("BaseResultMap")
    List<CoachInfo> selectSecretCoachInfoByStoreId(@Param("storeId") int storeId);

    /**
     * 根据教练手机号码 查询教练信息
     * @param mobile 手机号码
     * @return
     */
    CoachInfo queryCoachByMobile(String mobile);

    /**
     * 根据教练手机号码 查询教练信息及进店密码
     * @param mobile 手机号码
     * @return
     */
    CoachInfo queryCoachAndPwdByMobile(String mobile);
    
    /**
     * 根据门店查询私教
     * @param paramsMap
     * @return
     */
    List<CoachInfo> queryCoachPrivateListByStoreId(Map<String,Object> paramsMap);
    
    /**
     * 根据教练类型查询教练
     * @param paramsMap
     * @return
     */
    List<CoachInfo> queryCoachAllListByCoachType(Map<String,Object> paramsMap);
    
    /**
     * 查询私教正在上的课程
     * @param coachId
     * @return
     */
    List<CoachOngoingCourse> queryPtCoachOngoingCourseByCoachId(Integer coachId);
}